// 相关请求
import { ApiHttp } from "@/constant";

// 获取web预览文件地址
export const getViewUrlWebPath = (params) => {
  return ApiHttp.get("/v1/api/file/getViewUrlWebPath", { params: params });
};

export const getPreview = (name) => {
  return ApiHttp.get(`/v1/api/file/download/${name}`, { responseType: "blob" });
};
export const getPreviewById = (fileId) => {
  return ApiHttp.get(`/v1/api/file/download/file/${fileId}`, {
    responseType: "blob",
  });
};
export const getPreviewByUrl = (url) => {
  return ApiHttp.get(`/v1/api/file/download/url/${url}`, {
    responseType: "blob",
  });
};


export const sendDocument = (params) => {
  return ApiHttp.post("/unify-auth/api/public/v1/privacy/policy/mail", params, {
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}